/*
 * Main.cpp
 *
 *  Created on: Jul 11, 2009
 *      Author: mosh
 */

#include "file_sys.h"

int main(){


	Disk d("config.ini");
//
	FreeBlockManager manager(&d);
//
	InodeManager iManager(&manager,&d);
//
	iManager.construct_free_inode_list();
//
	LowLevelDiskServices service(&d,&manager,&iManager);
//
	FileSystem system(&service);
//	cout<<"b\n";

	int file = system.createFile(Normal);
	char *buffer = new char[100];
	for(int i = 0; i < 100; ++i)
		buffer[i] = 'a';
	system.f_write(file,buffer,50,100);
//
//	list *l = new list;
//	l->number = 5;
//	l->enteries = new directory_entry[5];
//	directory_entry d0;
////
//	strcpy(d0.name, "Mak");
//	d0.number = 3;
//	l->enteries[0] = d0;
////
//	directory_entry d1;
//	strcpy(d1.name, "pak");
//	d1.number = 2;
//	l->enteries[1] = d1;
////
//	directory_entry d2;
//	strcpy(d2.name, "mong");
//	d2.number = 6;
//	l->enteries[2] = d2;
////
//	directory_entry d3;
//	strcpy(d3.name , "jly");
//	d3.number = 5;
//	l->enteries[3] = d3;
////
//	directory_entry d4;
//	strcpy(d4.name , "gec");
//	d4.number = 9;
//	l->enteries[4] = d4;
////
//	system.d_write(file,l);


//
//	inode* i = (inode*)d.read_inode(file);
//
//	printInode(i);


//	list *l2 = system.d_read(0);
////
//	for(int i = 0; i < l2->number; ++i){
//		cout<<l2->enteries[i].name<<" ";
//	}
//	cout<<endl;
//
//	system.f_delete(1);

	cout<<file<<endl;



	cout<<"done\n";

}

